/* 容器整体样式 */
.chatHistoryContainer {
  margin-top: 140px; /* 与"新增面具"按钮间距对齐 */
  padding: 0 12px;
  height: 390px;
  box-sizing: border-box;
  overflow-y: auto;
 background-color: rgba(250, 247, 247, 0.5);
}

/* 滚动条美化 */
.chatHistoryContainer::-webkit-scrollbar {
  width: 6px;
}
.chatHistoryContainer::-webkit-scrollbar-track {
  background: #f5f0e8;
  border-radius: 3px;
}
.chatHistoryContainer::-webkit-scrollbar-thumb {
  background:  #1e88e5;
  border-radius: 3px;
  transition: background 0.2s ease;
}
.chatHistoryContainer::-webkit-scrollbar-thumb:hover {
  background: #1e88e5;
}

/* 列表头部 */
.historyHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #f0e6d6;
}
.headerTitle {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin: 0;
}
.sessionCount {
  font-size: 12px;
  color: #999;
  background-color: #f0e6d6;
  padding: 2px 8px;
  border-radius: 12px;
}

/* 操作提示栏（成功/失败） */
.tipBar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 0 0 10px 0;
  border-radius: 6px;
  font-size: 13px;
  transition: opacity 0.3s ease;
}
.successTip {
  background-color: #f0fff4;
  color: #52c41a;
}
.errorTip {
  background-color: #fff2f0;
  color: #ff4d4f;
}
.tipIcon {
  font-size: 14px;
}
.tipText {
  flex: 1;
}

/* 会话列表 */
.sessionList {
  height: 200px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 会话项样式 */
.sessionItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid transparent;
}
/* hover状态优化 */
.sessionItem:hover {
  background-color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 122, 69, 0.15);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
/* 点击:active状态 */
.sessionItem:active {
  background-color: rgba(255, 122, 69, 0.05);
  transform: scale(0.99);
}

/* 面具头像 */
.maskAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: whitesmoke;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatarImage {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.avatarText {
  font-size: 16px;
  font-weight: 500;
  color:  #1e88e5;
}

/* 会话信息区域 */
.sessionInfo {
  flex: 1;
  min-width: 0; /* 解决文本溢出问题 */
}
.sessionHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.sessionTopic {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sessionTime {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
}
.lastMessage {
  font-size: 12px;
  color: #666;
  margin: 0 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.maskTag {
  font-size: 11px;
  color:  #1e88e5;
  background-color: rgba(255, 122, 69, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* 直接删除按钮（核心样式） */
.deleteBtn {
  padding: 4px 8px;
  background-color: transparent;
  color:  #1e88e5;
  border: 1px solid  #1e88e5;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0; /* 默认隐藏，hover时显示 */
  white-space: nowrap;
}
/* 会话项hover时显示删除按钮 */
.sessionItem:hover .deleteBtn {
  opacity: 1;
}
/* 删除按钮hover状态 */
.deleteBtn:hover {
  background-color: #fff2f0;
  color:  #1e88e5;
  border-color:  #1e88e5;
}

/* 加载状态 */
.loadingContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 122, 69, 0.2);
  border-top-color: #ff7a45;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loadingText {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* 无会话状态 */
.emptyContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  gap: 12px;
  color: #999;
  text-align: center;
  padding: 0 20px;
}
.emptyIcon {
  font-size: 32px;
}
.emptyText {
  font-size: 16px;
  margin: 0;
  font-weight: 500;
}
.emptyTip {
  font-size: 13px;
  margin: 0;
}

/* 响应式适配（移动端优化） */
@media (max-width: 768px) {
  .chatHistoryContainer {
    margin-top: 100px;
    height: calc(100% - 100px);
    padding: 0 8px;
  }

  /* 移动端：删除按钮默认显示 */
  .deleteBtn {
    opacity: 1;
    padding: 3px 6px;
    font-size: 11px;
  }

  /* 移动端：简化会话信息 */
  .sessionHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 2px;
  }
  .sessionTime {
    font-size: 11px;
  }
  .lastMessage {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .maskTag {
    font-size: 10px;
    padding: 1px 4px;
  }

  /* 移动端：调整头像大小 */
  .maskAvatar {
    width: 32px;
    height: 32px;
  }
  .avatarText {
    font-size: 14px;
  }

  /* 移动端：提示栏简化 */
  .tipBar {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* 加载动画关键帧 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}